cmake_minimum_required(VERSION 2.8 FATAL_ERROR)

include_directories(${CMAKE_CURRENT_SOURCE_DIR})

find_package(LibSeawifs REQUIRED)
include_directories(${LibSeawifs_INCLUDE_DIRS})
set(LIBS ${LibSeawifs_LIBRARIES})

find_package(LibHdf4utils REQUIRED)
include_directories(${LibHdf4utils_INCLUDE_DIRS})
list(APPEND LIBS ${LibHdf4utils_LIBRARIES})

ADD_LIBRARY(osmi
  get_cal_osmi.c
  get_cal_misc_osmi.c
  calibrate_l1a_osmi.c
  calday.c
  obliq.c
  sunpos.c
  ctogd.c
  gmha.c
  tconv.c
  ctotc.c
  julian.c
  time-utils.c
  eanom.c
  locate.c
)

target_link_libraries(osmi ${LIBS})

install (TARGETS osmi DESTINATION lib)
